{% extends "iphone/base.html" %}

{% block body %}
    <div data-role="page" data-theme="b">
        <div data-role="header">
            {% if not is_ajax %}
                <a href="/" data-role="button" data-icon="arrow-l">Back</a>
            {% endif %}
            <h1>{{ channel_name }}</h1>
        </div>

        <div data-role="content">
            {% if enough_files %}
            <video width="320" height="240" autoplay controls>
                <source src="/live/{{ channel_number }}/playlist.m3u8">
            </video>
            {% else %}
                Please wait...
                <script>
                    setTimeout("window.location.reload()", 2000);
                </script>
            {% endif %}
        </div>
    </div> 
{% endblock %}
